package sudroid.json;

public class CDL
{
  private static String getValue(JSONTokener paramJSONTokener)
    throws JSONException
  {
    int i;
    do
      i = paramJSONTokener.next();
    while ((i == 32) || (i == 9));
    String str;
    switch (i)
    {
    default:
      paramJSONTokener.back();
      str = paramJSONTokener.nextTo(44);
    case 0:
    case 34:
    case 39:
    case 44:
    }
    while (true)
    {
      return str;
      str = null;
      continue;
      str = paramJSONTokener.nextString(i);
      continue;
      paramJSONTokener.back();
      str = "";
    }
  }

  public static JSONArray rowToJSONArray(JSONTokener paramJSONTokener)
    throws JSONException
  {
    JSONArray localJSONArray1 = new JSONArray();
    String str1 = getValue(paramJSONTokener);
    if ((str1 == null) || ((localJSONArray1.length() == 0) && (str1.length() == 0)));
    int i;
    for (JSONArray localJSONArray2 = null; ; localJSONArray2 = localJSONArray1)
    {
      return localJSONArray2;
      JSONArray localJSONArray3 = localJSONArray1.put(str1);
      do
      {
        i = paramJSONTokener.next();
        if (i == 44)
          break;
      }
      while (i == 32);
      if ((i != 10) && (i != 13) && (i != 0))
        break label86;
    }
    label86: String str2 = "Bad character '" + i + "' (" + i + ").";
    throw paramJSONTokener.syntaxError(str2);
  }

  public static JSONObject rowToJSONObject(JSONArray paramJSONArray, JSONTokener paramJSONTokener)
    throws JSONException
  {
    JSONArray localJSONArray = rowToJSONArray(paramJSONTokener);
    if (localJSONArray != null);
    for (JSONObject localJSONObject = localJSONArray.toJSONObject(paramJSONArray); ; localJSONObject = null)
      return localJSONObject;
  }

  public static String rowToString(JSONArray paramJSONArray)
  {
    StringBuffer localStringBuffer1 = new StringBuffer();
    int i = 0;
    int j = paramJSONArray.length();
    if (i >= j)
    {
      StringBuffer localStringBuffer2 = localStringBuffer1.append(10);
      return localStringBuffer1.toString();
    }
    if (i > 0)
      StringBuffer localStringBuffer3 = localStringBuffer1.append(44);
    Object localObject = paramJSONArray.opt(i);
    String str;
    if (localObject != null)
    {
      str = localObject.toString();
      if (str.indexOf(',') < 0)
        break label142;
      if (str.indexOf('"') < 0)
        break label115;
      StringBuffer localStringBuffer4 = localStringBuffer1.append(39);
      StringBuffer localStringBuffer5 = localStringBuffer1.append(str);
      StringBuffer localStringBuffer6 = localStringBuffer1.append(39);
    }
    while (true)
    {
      i += 1;
      break;
      label115: StringBuffer localStringBuffer7 = localStringBuffer1.append(34);
      StringBuffer localStringBuffer8 = localStringBuffer1.append(str);
      StringBuffer localStringBuffer9 = localStringBuffer1.append(34);
      continue;
      label142: StringBuffer localStringBuffer10 = localStringBuffer1.append(str);
    }
  }

  public static JSONArray toJSONArray(String paramString)
    throws JSONException
  {
    return toJSONArray(new JSONTokener(paramString));
  }

  public static JSONArray toJSONArray(JSONArray paramJSONArray, String paramString)
    throws JSONException
  {
    JSONTokener localJSONTokener = new JSONTokener(paramString);
    return toJSONArray(paramJSONArray, localJSONTokener);
  }

  public static JSONArray toJSONArray(JSONArray paramJSONArray, JSONTokener paramJSONTokener)
    throws JSONException
  {
    Object localObject;
    if ((paramJSONArray == null) || (paramJSONArray.length() == 0))
      localObject = null;
    while (true)
    {
      return localObject;
      JSONArray localJSONArray1 = new JSONArray();
      while (true)
      {
        JSONObject localJSONObject = rowToJSONObject(paramJSONArray, paramJSONTokener);
        if (localJSONObject == null)
        {
          if (localJSONArray1.length() != 0)
            break label58;
          localObject = null;
          break;
        }
        JSONArray localJSONArray2 = localJSONArray1.put(localJSONObject);
      }
      label58: localObject = localJSONArray1;
    }
  }

  public static JSONArray toJSONArray(JSONTokener paramJSONTokener)
    throws JSONException
  {
    return toJSONArray(rowToJSONArray(paramJSONTokener), paramJSONTokener);
  }

  public static String toString(JSONArray paramJSONArray)
    throws JSONException
  {
    JSONObject localJSONObject = paramJSONArray.optJSONObject(0);
    StringBuilder localStringBuilder;
    String str2;
    if (localJSONObject != null)
    {
      JSONArray localJSONArray = localJSONObject.names();
      if (localJSONArray != null)
      {
        String str1 = String.valueOf(rowToString(localJSONArray));
        localStringBuilder = new StringBuilder(str1);
        str2 = toString(localJSONArray, paramJSONArray);
      }
    }
    for (String str3 = str2; ; str3 = null)
      return str3;
  }

  public static String toString(JSONArray paramJSONArray1, JSONArray paramJSONArray2)
    throws JSONException
  {
    String str1;
    if ((paramJSONArray1 == null) || (paramJSONArray1.length() == 0))
    {
      str1 = null;
      return str1;
    }
    StringBuffer localStringBuffer1 = new StringBuffer();
    int i = 0;
    while (true)
    {
      int j = paramJSONArray2.length();
      if (i >= j)
      {
        str1 = localStringBuffer1.toString();
        break;
      }
      JSONObject localJSONObject = paramJSONArray2.optJSONObject(i);
      if (localJSONObject != null)
      {
        String str2 = rowToString(localJSONObject.toJSONArray(paramJSONArray1));
        StringBuffer localStringBuffer2 = localStringBuffer1.append(str2);
      }
      i += 1;
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.json.CDL
 * JD-Core Version:    0.6.0
 */